package com.zy.cat.entity.ztk.resp;

import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang3.StringUtils;

import com.fasterxml.jackson.annotation.JsonIgnore;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("花生必购商品回调实体类")
public class ZTKBGResp  {
	@ApiModelProperty(value = "花生必购商品ID", example = "10010")
	private String taoId;

	@ApiModelProperty(value = "商品短标题", example = "储物箱整理抽屉式收纳柜")
	private String title;
	
	@ApiModelProperty(value = "商品长标题", example = "抽屉式收纳箱塑料储物箱整理箱衣服物家用宿舍衣柜内衣内裤收纳盒")
	private String taoTitle;

	@ApiModelProperty(value = "商品文案", example = "储物箱整理抽屉式收纳柜")
	private String jianjie;

	@ApiModelProperty(value = "商品主图", example = "https")
	private String pictUrl;

	@ApiModelProperty(value = "是否天猫，0是淘宝，1是天猫", example = "0")
	private String userType;
	
	@ApiModelProperty(value = "商品月销量", example = "400")
	private String volume;
	
	@ApiModelProperty(value = "商品原价", example = "400")
	private double size;
	
	@ApiModelProperty(value = "最后更新时间", example = "2018-11-8 14:45:22")
	private String ltime;
	
	@ApiModelProperty(value = "商品券后价", example = "100")
	private double quanhouJiage;
	
	@ApiModelProperty(value = "优惠券开始时间", example = "2018-11-8")
	private String couponStartTime;
	
	@ApiModelProperty(value = "优惠券结束时间", example = "2018-11-8")
	private String couponEndTime;
	
	@ApiModelProperty(value = "优惠券金额", example = "20")
	private double couponInfoMoney;
	
	@ApiModelProperty(value = "优惠券信息", example = "满80元减10元")
	private String couponInfo;
	
	@ApiModelProperty(value = "文案图列表", example = "https://")
	private List<String> smallImages;
	
	@JsonIgnore
	@ApiModelProperty(value = "分成比例", example = "https://")
	private double rate;
	
	@ApiModelProperty(value = "积分", example = "https://")
	private long fcode;
	
	@ApiModelProperty(value = "视频地址", example = "https://")
	private String zhiboUrl;

	@SuppressWarnings("unchecked")
	public void setSmallImages(Object smallImages) {
		if(smallImages==null) {
			return;
		}
		String st="";
		if(smallImages.getClass().getName().contains("ArrayList")) {
			this.smallImages=(List<String>) smallImages;
		}else {
			st=smallImages.toString();
		}
		if(StringUtils.isNotBlank(st)) {
			this.smallImages =  Arrays.asList(st.split("\\|")) ;
		}
	 
	}

	public ZTKBGResp(double rate) {
		super();
		this.rate = rate;
	}
	
	
}
